#include <iostream>
using namespace std;
int main()
{
  int h,m,s;
  double rh,rm,rs,A,B;
  for(int i=1;i<=21600;i++){
    h=i/3600;
    m=(i-h*3600)/60;
    s=i%60;
    rh=(h+m/60.0+s/3600.0)*30;
    rm=(m+s/60.0)*6;
    rs=s*6;
    A=abs(rh-rm);
    B=abs(rm-rs);
    if(A>180)A=360-A;
    if(B>180)B=360-B;
    if(A==2*B)
      cout<<h<<" "<<m<<" "<<s<<endl;
  }
}